using System;
using System.Collections.Generic;

using Microsoft.Practices.EnterpriseLibrary.Logging;

namespace SBPweb.Logging
{
	public static partial class LogManager
	{
		private static String mBaseFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + System.IO.Path.DirectorySeparatorChar;

		private static volatile LogWriter mLogWriter;
		private static volatile bool mEnableWriter = true;


		/// <summary>
		/// Gets or sets the logging base folder.
		/// </summary>
		/// <remarks>
		/// You must assign this before the initialization of the logging system or your setting will not take effect.
		/// The default value is the current user's application data folder. If you want to specify your log file path relatively to this path
		/// then you have to specify relative path for LogFolder's <see cref="LogFolder.Folder"/> and <see cref="LogFolder.ArchiveFolder"/>.
		/// </remarks>
		/// <example>
		/// The following code shows how to set this application wise setting.
		/// <code>
		/// private void MainForm_Load(object sender, EventArgs e)
		/// {
		///     // You must assign this before the initialization of the logging system or your setting will not take effect.
		///     LogManager.BaseFolder = @"c:\Log\";
		/// 
		///     LogManager.Initialize();
		/// }
		/// </code>
		/// </example>
		public static String BaseFolder
		{
			get
			{
				return mBaseFolder;
			}
			set
			{
				mBaseFolder = value;
			}
		}

		/// <summary>
		/// Gets or sets if writers are enabled or not.
		/// </summary>
		/// <remarks>
		/// This property can be used to enable and disable logging runtime. The default value is true.
		/// </remarks>
		public static bool EnableWriter
		{
			get
			{
				return mEnableWriter;
			}
			set
			{
				mEnableWriter = value;
			}
		}
	}
}
